﻿
function getMainLoc() {//提取主url：http://xxx.com
	var loc = window.location.toString();
	var idx1 = loc.indexOf("//");
	if(idx1>0){
		var idx2 = loc.indexOf("/", idx1+2);
		if(idx2>idx1){
			return loc.substring(0, idx2);
		}
	}
	return loc;
}
